<template>
    <div>
        <h1>房间信息</h1>
        <table class="table">
            <thead>
                <tr>
                    <th>房间Id</th>
                    <th>房号</th>
                    <th>房间名称</th>
                    <th>价格</th>
                    <th>日期</th>
                </tr>
            </thead>
            <tbody>
                <tr v-for="a in data">
                    <th>{{a.Id}}</th>
                    <th>{{a.StoreId}}</th>
                    <th>{{a.Name}}</th>
                    <th>{{a.Price}}</th>
                    <th>{{a.date}}</th>
                </tr>
            </tbody>
        </table>
        <a href="/Add">添加房间信息</a>
    </div>
</template>

<script setup lang="ts">
    import { ref,onMounted } from 'vue';
    import axios from 'axios';   
    const data = ref([{
    "Id": 1,
    "Name": "",
    "StoreId": "",
    "date": "2025-03-10T01:21:37.908",
    "Price": 0
    }])
    onMounted(()=>{
        Show()
    })
    const Show=()=>{
        axios.get("https://localhost:7182/api/Store/GetAll",{params:data.value}).then(res=>{
            data.value = res.data
        })
    }
</script>

<style scoped>

</style>